This invention relates to a sample rate converter, and in particular to a method and apparatus for calculating time positions at which output sample values should be generated.
In many situations, signals, such as audio signals, are stored in the form of digital signals. That is, the continuously varying analog signal is sampled at predetermined times, and the values of the signal at these sampling times are stored in a digital form. The digital form of signal can then conveniently be stored on digital media such as optical or magnetic discs, and can conveniently be transmitted over digital channels such as those found in internet connections or in wireless communication networks.
An important feature of such a digital signal, and in particular a digital audio signal, is the sampling rate, or sampling frequency, that is, the number of samples that are taken in a fixed period of time. For example, digital audio signals stored on audio compact discs have a sampling frequency of 44.1 kHz. That is, 44,100 samples are taken in each second. Other digital audio formats have different sampling frequencies.
When a digital signal in one format is to be converted to a different format, it becomes necessary to perform a sample rate conversion.
In order to be able to perform a sample rate conversion from a first digital signal to a second digital signal, it is necessary firstly to determine the time positions, for which output sample values in the second digital signal should be calculated. These time positions, for the output sample values in the second digital signal, can be expressed relative to the time positions of the input sample values in the first digital signal. For example, in a simple case, where the sample rate is to be doubled, say from 24 kHz to 48 kHz, it is apparent that that the time positions for the output sample values in the second digital signal should most conveniently include all of the time positions of the input sample values in the first digital signal plus time positions exactly half way between the time positions of each pair of successive input sample values.
When the time positions have been determined, then the required output sample values can be calculated, using the input sample values in the first digital signal in an interpolation process, as required.
As mentioned above, there can be simple cases, where it is straightforward to generate the time positions, for which output sample values should be calculated. However, it is advantageous to be able to use a method that is applicable in all cases.